package net.chenlin.dp.modules.base.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.chenlin.dp.common.entity.Page;
import net.chenlin.dp.common.entity.Query;
import net.chenlin.dp.common.entity.R;
import net.chenlin.dp.common.utils.CommonUtils;
import net.chenlin.dp.modules.base.entity.SysFeitieXiaoshuoEntity;
import net.chenlin.dp.modules.base.manager.SysFeitieXiaoshuoManager;
import net.chenlin.dp.modules.base.service.SysFeitieXiaoshuoService;

/**
 * 废铁销售
 *
 * @author ZhouChenglin
 * @email yczclcn@163.com
 * @url www.chenlintech.com
 * @date 2018年12月04日 下午9:15:01
 */
@Service("sysFeitieXiaoshuoService")
public class SysFeitieXiaoshuoServiceImpl implements SysFeitieXiaoshuoService {

	@Autowired
	private SysFeitieXiaoshuoManager sysFeitieXiaoshuoManager;

	@Override
	public Page<SysFeitieXiaoshuoEntity> listSysFeitieXiaoshuo(Map<String, Object> params) {
		Query query = new Query(params);
		Page<SysFeitieXiaoshuoEntity> page = new Page<>(query);
		sysFeitieXiaoshuoManager.listSysFeitieXiaoshuo(page, query);
		return page;
	}

	@Override
	public R saveSysFeitieXiaoshuo(SysFeitieXiaoshuoEntity role) {
		int count = sysFeitieXiaoshuoManager.saveSysFeitieXiaoshuo(role);
		return CommonUtils.msg(count);
	}

	@Override
	public R getSysFeitieXiaoshuoById(Long id) {
		SysFeitieXiaoshuoEntity sysFeitieXiaoshuo = sysFeitieXiaoshuoManager.getSysFeitieXiaoshuoById(id);
		return CommonUtils.msg(sysFeitieXiaoshuo);
	}

	@Override
	public R updateSysFeitieXiaoshuo(SysFeitieXiaoshuoEntity sysFeitieXiaoshuo) {
		int count = sysFeitieXiaoshuoManager.updateSysFeitieXiaoshuo(sysFeitieXiaoshuo);
		return CommonUtils.msg(count);
	}

	@Override
	public R batchRemove(Long[] id) {
		int count = sysFeitieXiaoshuoManager.batchRemove(id);
		return CommonUtils.msg(id, count);
	}

}
